function T = trpzInt(f, min, max, h)
%TRPZINT Calculates integral of function f, IAW the trapez-rule.
%   f - the function (integrand)
%   min - low boundary of integral
%   max - high boundary of integral
%   h - 

%disp(['f=' num2str(f(1))]);
%f
%disp(['f=' num2str(f(1)) num2str(f([1 2]))]);

S=0;
for i = min + h : h : max - h
    S=S+f(i);

%T = h .* (0.5 .* (f(min) + f(max)) + sum(f(min + h : h : max - h)));
T = h .* (0.5 .* (f(min) + f(max)) + S);

end

